package day3.p7;

@SuppressWarnings("unused")
public class Emp {
	private int empId;
	private String empName;
	private String designation;
	private double basic;
	private double hra;

	public Emp(int empId, String empName, String designation, double basic) {
		try {
			if (basic < 500) throw new LowSalException();
		} catch (LowSalException e) {
		}
		this.empId = empId;
		this.empName = empName;
		this.designation = designation;
		this.basic = basic;

	}

	public void printDET() {
	}

	public void calculateHRA() {
		if (this.designation.equalsIgnoreCase("Manager"))
			this.hra = this.basic * 0.1;
		else if (this.designation.equalsIgnoreCase("Officer"))
			this.hra = this.basic * 0.12;
		else if (this.designation.equalsIgnoreCase("Clerk"))
			this.hra = this.basic * 0.05;
	}
}
